package zuoye1015;

public class Application {
	public static void main(String args[]) {
		Simulator simulator = new Simulator();
		Dog dog = new Dog();
		Cat cat = new Cat();
		dog.cry1("汪汪");
		dog.animalName1("狗");
		cat.cry1("喵");
		cat.animalName1("猫");
		simulator.playSound(dog);
		simulator.playSound(cat);
	}
}
class Animal{
	String cry;
	String animalName;
	void cry1(String m) {
		this.cry = m ;
	}
	String cry2() {
		return cry;
	}
	void animalName1(String n) {
		this.animalName = n;
	}
	String animalName2() {
		return animalName;
	}
}
class Dog extends Animal{
	
}
class Cat extends Animal{
	
}
class Simulator{
	void playSound(Animal animal) {
		System.out.println(animal.cry2()+"的"+animal.animalName2());
	}
}

